home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / apps / 14 / general / ioport.doc < prev    next >
Encoding:
Text File  |  1986-05-15  |  14.2 KB  |  529 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.               An Input/OUTPUT Port for the Cartridge Slot of the
  7.          520ST
  8.  
  9.               By Douglas P. B. Renaux - Feb 27, 1986.
  10.  
  11.  
  12.               This document describes the hardware and software of a 8
  13.          lines input/
  14.          16 lines output port. The circuitry is connected to the
  15.          Cartridge Slot of
  16.          the ATARI 520 ST.
  17.  
  18.               IMPORTANT!!! - INFORMATION IN THIS DOCUMENT CAN BE
  19.          FREELY USED AND
  20.          COPIED. HOWEVER, NO CHANGES CAN BE MADE TO IT WITHOUT
  21.          CONSULTING THE AUTHOR
  22.          FIRST, NOR THE AUTHOR'S NAME CAN BE OMISSED IN THE COPIES.
  23.  
  24.  
  25.               Foreword
  26.  
  27.               Although the Cartridge Slot is intended for data input,
  28.          specifically
  29.          from a ROM, it can be used as an output port. To substitute
  30.          the READ/WRITE
  31.          line, that is not available on the slot, I used a WRITE
  32.          ENABLE LATCH. This
  33.          latch is set by READING a memory location. The consequence of
  34.          seting this
  35.          latch is that the output latches will read the data bus
  36.          during the next
  37.          instruction, which will be a memory WRITE that outputs the
  38.          desired data.
  39.  
  40.  
  41.               1 - The signals available on the Cartridge Slot
  42.  
  43.                    D0..D15 - DATA BUS
  44.                    A1..A15 - The 15 least significant addresses from
  45.          the ADDRESS BUS
  46.               ROM 3 SELECT - Active when a READ instruction accesses
  47.          $FB0000 to
  48.                              $FBFFFF
  49.                  UDS',LDS' - Upper and Lower Data Strobe
  50.  
  51.  
  52.               2 - The I/O PORT
  53.  
  54.               The block diagram of the I/O PORT is in the file
  55.          BLOCKDIA.PI3. Cir-
  56.          cuit diagrams are in ADDRESS.PI3 and IN'OUT.PI3. If you don't
  57.          have these
  58.          drawings then in appendix A you can read a description of the
  59.          circuit.
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.               The circuit of the I/O PORT is standard. A address
  73.          decoder enables the
  74.          output latches or the input buffers when the correct address
  75.          is accessed.
  76.          However, the output latches are only enabled if previously
  77.          the WRITE ENABLE
  78.          LATCH was set.
  79.  
  80.  
  81.  
  82.               Address Decoder:
  83.               The lines A3..A15 are connected to NAND gates that
  84.          detect when all
  85.          these lines are at high level. The lines A2 and A1, select
  86.          one of the
  87.          four outputs of a decoder.
  88.  
  89.               The output of the NOR gate "a" is active when we read
  90.          from $FBFFFE.
  91.          To decode a read to this address we use the outputs of the
  92.          two NAND gates,
  93.          the output three of the decoder (active when A1 and A2 are
  94.          high) and the
  95.          line ROM 3 SELECT.
  96.               The output of NOR gate "a" sets the WRITE ENABLE LATCH.
  97.  
  98.               The output of NOR gate "b" decodes the address $XXFFFC.
  99.          To decode an
  100.          access to these addresses (read or write), we use the outputs
  101.          of the NAND
  102.          gates, output two of the decoder and the line LDS'.
  103.               ROM 3 SELECT cannot be used here because it is only
  104.          active on read.
  105.               When a write instruction accesses the address $10FFFC
  106.          (non-existent
  107.          in 1MByte ST's) then the output of NOR gate "b" becomes
  108.          active.
  109.  
  110.               An AND gate enables the output latches to read the data
  111.          bus if the
  112.          WRITE ENABLE LATCH is set AND the output of NOR gate "b" is
  113.          active.
  114.  
  115.               The output of NOR gate "b" is delayed (by four
  116.          inverters) and then
  117.          resets the WRITE ENABLE LATCH, just after the latches have
  118.          read the data
  119.          bus.
  120.  
  121.               NOR gate "c" decodes a read to address $FBFFFA, as gate
  122.          "a" does, but
  123.          using output one of the decoder. The output of gate "c"
  124.          enables the buffers
  125.          to copy their inputs to the data bus.
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.               3 - Components
  141.  
  142.               2- 4068    NAND               gates for address
  143.          decoding
  144.               2- 4002    NOR                gates for address
  145.          decoding
  146.               1- 4556    1 OF 4 DECODER     for address decoding
  147.  
  148.               1- 4043    SR FLIP-FLOP       write enable latch
  149.               1- 4049    INVERTER
  150.               1- 4081    AND
  151.  
  152.               2- 40373   LATCHES            output latches
  153.               1- 74LS244 BUFFERS            input buffers
  154.  
  155.  
  156.  
  157.               4 - Expansion
  158.  
  159.               This I/O PORT is easily expandable to as many I/O lines
  160.          you want. Only
  161.          one WRITE ENABLE LATCH is necessary if the expansion is made
  162.          in a way that
  163.          any write to port instruction resets the latch. Another
  164.          solution is to have
  165.          a reset latch address (as we have a set latch address). In
  166.          this case the
  167.          write to port instructions don't need to reset the latch, and
  168.          you can output
  169.          a block of data to several addresses without needing to set
  170.          the latch in
  171.          between. Only at the end of the block transfer this would be
  172.          necessary.
  173.               You can have another 8 inputs by just connecting another
  174.          74LS244 to
  175.          D8..D15 of the data bus.
  176.  
  177.  
  178.  
  179.               5 - Software
  180.  
  181.               To write to the output lines the contents of D0:
  182.  
  183.                    MOVE.W    $FBFFFE,D1     ;D1 is destroyed, latch is
  184.          set
  185.                    MOVE.W    D0,$10FFFC     ;D0 is latched
  186.  
  187.               To read the input lines to D0:
  188.  
  189.                    MOVE.W    $FBFFFA,D0
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.               6 - Connection to the ST
  205.  
  206.               I could not find a experimentor PC Board with an edge
  207.          connector that
  208.          fits to the ST. So I made a convertor from the 40 pin edge
  209.          connector (with
  210.          spacing of 2mm) to a 64 pins euroconnector (DIN 41612). This
  211.          convertor is
  212.          simply a double sided PCB with 20 lines (on each side) of 1mm
  213.          spaced by 2mm
  214.          (center of one line to center of next line). These lines
  215.          widen to 2.54 mm
  216.          to fit the DIN connector. Line one of the ST goes to line 4
  217.          of the DIN
  218.          connector. The tabs of the DIN connector are on the lower
  219.          side.
  220.                          ______
  221.                          ||   |
  222.                          |.  .|  1
  223.                          |.  .|  2
  224.                          |.  .|  3
  225.                        + |.  .|  4 +
  226.                  Data 15 |.  .|  5 Data 14
  227.                          |.  .|
  228.                      :   |    |     :
  229.                      :   |    |     :
  230.                          |    |
  231.                   Ground |.  .| 23 Ground
  232.                          |    |
  233.                          |.  .| 31
  234.                          |.  .| 32
  235.                          ||   |     DIN connector seen from front
  236.          (connection) side
  237.                          ------
  238.  
  239.               I intend to connect some of the free lines of this
  240.          connector to inter-
  241.          nal signals of the ST. Would be nice to have a standard
  242.          connector between
  243.          ST users.  Whoever has ideas about which signals to connect
  244.          and to which
  245.          pin should let the others know about it.
  246.  
  247.  
  248.  
  249.  
  250.               7 - Conclusion
  251.  
  252.               It is possible to open the ST !!
  253.               And this opens a lot of possibilities in hardware
  254.          design. The 68000's
  255.          power can be used outside the ST's box.
  256.               But a complex machine like the ST cannot be easily
  257.          expanded without
  258.          having information about it. The information that ATARI
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.          delivers only to
  271.          software houses. Please ATARI, let everybody know about the
  272.          ST. Let the
  273.          POWER be available to all users.
  274.  
  275.  
  276.  
  277.                                                            Douglas P.
  278.          B. Renaux
  279.                                                            Outshoornst
  280.          raat 55
  281.                                                            5622GX
  282.          Eindhoven - NL
  283.                                                            Tel
  284.          31-40-436930
  285.                                                   (Address valid until
  286.          May 25,1986)
  287.  
  288.                                              People dealing with
  289.          hardware design
  290.                                              are cordially invited to
  291.          contact me.
  292.  
  293.  
  294.               APPENDIX A
  295.  
  296.               Circuit Description.
  297.  
  298.               Block Diagram:
  299.  
  300.                                               write enable latch
  301.                    ___________                      ______
  302.                    |         | Read $FBFFFE         |    |
  303.          _____
  304.                    |         |----------------------|S
  305.          Q|------------| & |
  306.            A15..A1 | ADDRESS | $XXFFFC _________    |    |
  307.          |   |---|
  308.            LDS ----| DECODER |-----T---| Delay |----|R   |
  309.          |----|   |   |
  310.            ROM3 SEL|         |     |   ---------    ------       |
  311.          -----   |
  312.                    |         |     |_____________________________|
  313.          |
  314.                    |         |
  315.          |
  316.                    |         |-----------|
  317.          |
  318.                    -----------  Read     |
  319.          |
  320.                                $ FBFFFA  |
  321.          |---------
  322.                                      ---------
  323.          ------------
  324.                                      |       |                  |
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.          |
  337.                                      | INPUT |              D15 |
  338.          OUTPUT   |
  339.                           D7..D0-----|BUFFERS|---INPUTS       --|
  340.          LATCHES  |--OUT
  341.                                      |       |              D0  |
  342.          |
  343.                                      |       |                  |
  344.          |
  345.                                      ---------
  346.          ------------
  347.  
  348.  
  349.               Address Decoder Description:
  350.  
  351.               Address lines A15 to A3 are connected to the inputs of
  352.          two 4068
  353.          (8-input NAND). Inputs are pins 2,3,4,5,9,10,11,12. One of
  354.          these NAND
  355.          gates has three inputs tied high. Power supply is connected
  356.          to pin 14 (+)
  357.          and pin 7 (ground).
  358.               The address lines A2 and A1 are connected to the select
  359.          lines of the
  360.          4556 (1 of 4 decoder), pins 3 (A2) and 2 (A1). The enable
  361.          line (pin 1) is
  362.          tied low. Pins 16(+) and 8 (ground). The outputs of the
  363.          decoder are:
  364.          output 0 at pin 4, output 1 (pin 5), output 2 (pin 6), output
  365.          3 (pin 7).
  366.               The second level of the address decoding is done by
  367.          three NOR gates
  368.          of four inputs (4002). Two chips are necessary. These gates
  369.          are labelled
  370.          "a", "b" and "c".
  371.               Pinning of the 4002: inputs 2,3,4,5;      output pin 1
  372.                                    inputs 9,10,11,12;   output pin 13
  373.                                    power: pin 14 (+); pin 7 (ground).
  374.               Two inputs of gate "a" are connected to the outputs of
  375.          the 4068 (pin
  376.          13). The third input is connected to ROM3 SELECT and the
  377.          fourth input goes
  378.          to output 3 of the decoder. The output of gate "a" is
  379.          connected to the SET
  380.          input of the WRITE ENABLE LATCH.
  381.               Gate "b". Inputs: the two outputs of the 4068s, output 2
  382.          of the
  383.          decoder and LDS. The output of this gate is the line $XXFFFC
  384.          of the block
  385.          diagram, it goes to a chain of four inverters (4049) to
  386.          produce a delay,
  387.          and it goes to an AND gate.
  388.               Gate "c". Inputs: the two outputs of the 4068s, output 1
  389.          of the
  390.          decoder and ROM3 SELECT. The output of gate "c" is inverted
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.          by a 4049
  403.          and then connected to the enable line of the input buffers
  404.          (74LS244).
  405.  
  406.               Delay chain: The hex inverter 4049 (inputs pins
  407.          3,5,7,9,11,14; outputs
  408.          pins 2,4,6,10,12,15 respectively) is used. Four inverters are
  409.          chained to
  410.          give the desired delay and one inverter is used for the
  411.          enable of the input
  412.          buffer. Power is on pin 1 (+) and pin 8 (ground). Note that +
  413.          is NOT on
  414.          pin 16!
  415.  
  416.               Write enable latch: A 4043 (SR-latch) is used. SET is on
  417.          pin 4, RESET
  418.          on 3 and Q on 2. Pin 5 (output enable) is tied low. Power is
  419.          on pins 16 (+)
  420.          and 8 (ground). SET is connected to the output of gate "a".
  421.          RESET goes to
  422.          the output of the delay chain.
  423.  
  424.               AND gate (4081). Inputs: Q from the latch (connected to
  425.          pin 1) and
  426.          the output of gate "b" (connected to pin 2). The output of
  427.          this gate (pin 3)
  428.          enables the output latches. Power is on pins 14 (+) and 7
  429.          (ground).
  430.  
  431.               Output latches. Two 40373 (octal latches) are used.
  432.          Inputs (pins 3,4,
  433.          7,8,13,14,17,18) are connected to the DATA BUS. Outputs (pins
  434.          2,5,6,9,12,
  435.          15,16,19 respectively) are the outputs of the circuit. Pin 1
  436.          (output enable)
  437.          is tied low. Pin 11 (enable latches) goes to the output of
  438.          the AND gate.
  439.          Power to pins 20 (+) and 10 (ground).
  440.  
  441.               Input buffers. The 74LS244 (inputs 2,4,6,8,11,13,15,17
  442.          outputs 18,16,
  443.          14,12,9,7,5,3 respectively). The inputs of these buffers are
  444.          the inputs of
  445.          the circuit. The outputs are connected to the DATA BUS
  446.          (D0..D7). Pins 1 and
  447.          19 (output enable) are connected to the inverted output of
  448.          gate "c". Power
  449.          to pins 20 (+) and 10 (ground).
  450.  
  451.               I used the +5V from the cartridge slot to drive the
  452.          circuit and 16 leds
  453.          that monitor the outputs. (The leds are not connected
  454.          directly to the 40373,
  455.          but via buffers 4049).
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.